@isTest
private class EmailVelocityIgnoreHandler_Test
{
    public static testMethod void testEmailVelocityIgnoreHandler()
    {
        
        // test we only add one row     
        List<EmailVelocityIgnore__c> bvecs = [Select Id From EmailVelocityIgnore__c ];
        Integer beforeSize = bvecs.size();
        EmailVelocityIgnoreHandler.enable('FromAddy_test@salesforce.com', 'ToAddy_test@salesforce.com', 10);
        List<EmailVelocityIgnore__c> avecs = [Select Id From EmailVelocityIgnore__c ];
        System.assertEquals(beforeSize+1, avecs.size());
        
        // was it added correctly?
        List<EmailVelocityIgnore__c> added = EmailVelocityIgnoreHandler.get('FromAddy_test@salesforce.com', 'ToAddy_test@salesforce.com');
        System.assertEquals(1, added.size());
        
        // do we only insert one row with those addresses?
        EmailVelocityIgnoreHandler.enable('FromAddy_test@salesforce.com', 'ToAddy_test@salesforce.com', 10);
        List<EmailVelocityIgnore__c> avecs2 = [Select Id From EmailVelocityIgnore__c ];
        System.assertEquals(avecs2.size(), avecs.size());
        
        // does disable work?
        List<EmailVelocityIgnore__c> active = EmailVelocityIgnoreHandler.getActive();
        Integer actives = active.size();
        EmailVelocityIgnoreHandler.disable('FromAddy_test@salesforce.com', 'ToAddy_test@salesforce.com');
        List<EmailVelocityIgnore__c> active2 = EmailVelocityIgnoreHandler.getActive();
        System.assertEquals(actives-1, active2.size());
        
    }
}